Apparatus for determining the alignment of leads on a body

ABSTRACT

Apparatus for determining the alignment of leads extending from a body of an integrated circuit package, including an optical system for producing data having information of the spacing between the leads and a data processor for determining the spacing between the leads in response to the data. A package handler sorts the package under control by the data processor.

This application is a continuation of application Ser. No. 289,921,filed Aug. 3, 1981, and now abandoned.

BACKGROUND ART

This invention relates to apparatus for determining the alignment ofleads on a body and, more particularly, to electro-optical apparatus fordetermining the spacing between the leads on the body.

Quality control of products is of prime importance to a manufacturer, aswell as an end user of the products. Quality control procedures areimplemented at intermediate stages in the manufacture or assembly of theproducts, and final quality control procedures are employed on thefinished products. The variety of quality control techniques are asvaried as the different products being produced.

One type of manufactured product may be generally described as a bodyhaving at least one lead extending from the body. One particular exampleof such a product, made by semiconductor companies, is known as anintegrated circuit package. Typically each side of the package has aplurality of leads extending from the package body. The leads on eachside of the finished package must be substantially in-line, i.e.,aligned with one another. Otherwise, a defect such as misalignment ofthe leads can cause premature electrical or mechanical failure duringthe end use of the package.

Though stringent quality control techniques may be employed duringassembly of the package, a significant number of finished packages haveone or more bent leads which are not in-line. For example, one or moreleads can be bent towards one another along a line parallel to alongitudinal axis of the package, or can be bent away from one anotheralong a line perpendicular to the parallel line, or can have a combinedbending having a component along the parallel line and a component alongthe perpendicular line. Consequently, all finished packages should betested and those packages having bent leads should be rejected.

Furthermore, the bodies of many types of packages may include a base anda cover for the base, with the leads being supported between the coverand the base. Quality control is also concerned with producing finishedpackages having the cover substantially, if not precisely, aligned overthe base, edge-for-edge. However, in a number of finished packages, theedges of the cover are significantly offset from the edges of the base,which also is disadvantageous. Therefore, packages having this offsetshould be rejected.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide novel qualitycontrol apparatus.

Another object of the present invention is to provide apparatus fordetecting defects in a manufactured product.

Still another object of the present invention is to provide qualitycontrol apparatus that accurately determines if products have defectsand at maximum assembly line production rates.

The above and other objects of the present invention are carried out inone aspect of the invention which includes apparatus for determining thealignment of at least one lead extending from a body having an axis, thelead being subject to bending along a first line parallel to the axis,or being subject to bending along a second line perpendicular to thefirst line, or being subject to a combined bending having a componentalong the first line and a component along the second line, theapparatus comprising: first means for producing a first light beam beingadapted to traverse a first path along the second line and to intersectthe lead, first means for sensing the first light beam, second means forproducing a second light beam being adapted to traverse a second path atan angle to the first line and the second line and to intersect thelead, and second means for sensing the second light beam.

In this one aspect of the invention, optical data acquired with thefirst light beam producing means and first sensing means have firstinformation of the bending of the lead along the first line. Opticaldata acquired with the second light beam producing means and the secondsensing means have second information of any combined bending of thelead along the first line and second line. The first information of thebending along the parallel line can be subtracted from the secondinformation of the combined bending to also obtain information of thecomponent of the bending along the second line.

In another aspect of the invention, apparatus is provided fordetermining the alignment of a plurality of leads on a body, the leadsbeing spaced-apart from each other, comprising: optical means forproducing data having information of the spacing between the leads, anddata processor means for determining the spacing between the leads inresponse to the data. The results obtained with this other aspect of theinvention will indicate if the spacing is such that the leads are bentor are in-line.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view, in perspective, of a finished package.

FIG. 2 is a side elevation taken along lines 2--2 of FIG. 1.

FIG. 3 is an end view taken along lines 3--3 of FIG. 2.

FIG. 4 is a top view of the finished package of FIG. 1.

FIG. 5 is a view similar to FIG. 2 of another finished package.

FIG. 6 is a schematic top view of a portion of an optical system of thepresent invention in conjunction with the package of FIG. 1.

FIG. 7 is an end view taken along lines 7--7 of FIG. 6.

FIG. 8 is a schematic top view of another portion of the optical systemof the present invention in conjunction with the package of FIG. 1.

FIG. 9 is an end view taken along lines 9--9 of FIG. 8.

FIG. 10 is a top view of an overall optical system of the presentinvention in conjunction with the package of FIG. 1.

FIG. 11 is a view in perspective of a self-contained module of thepresent invention.

FIG. 12 is a cross section taken along lines 12--12 of FIG. 11.

FIG. 13 is a cross section taken along lines 13--13 of FIG. 12.

FIG. 14 is a block diagram of an electro-optical system of the presentinvention.

FIG. 15 illustrates seven pulse waveforms used to explain the presentinvention.

FIG. 16 illustrates six pulse waveforms used to explain the presentinvention.

FIG. 17 is a top view of a package handler of the present invention.

FIG. 18 is an end view taken along lines 18--18 of FIG. 17.

FIG. 19 is a cross section taken along lines 19--19 of FIG. 17.

FIG. 20 is an exploded view of the package handler taken around lines20--20 of FIG. 17.

FIG. 21 is a flow chart used to explain an algorithm of the presentinvention.

FIG. 22 is another flow chart used to explain another algorithm of thepresent invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 illustrates one example of a product 10 that can be in a givenstage of production. The product 10 includes an object or body 12 whichhas a front end 14, a rear end 16, a left side 18 and a right side 20. Aplurality of portions or leads 22, referenced respectively as 22-1,22-2, . . . , 22-n, extend from the body 12 on the left side 18. Aplurality of portions or leads 24, referenced respectively as 24-1,24-2, . . . , 24-n, extend from the body 12 on the right side 20. Thebody 12 has a base 26 and a cover 28, with the leads 22 and leads 24being supported between the base 26 and cover 28. Product 10 also can beconsidered to have an imaginary longitudinal axis A₁ and an imaginaryorthogonal or right angle axis A₂ for coordinate reference purposeswhich will become apparent. As one example, product 10 can be a finishedproduct known in the semiconductor industry as an n-lead, dual in-line,integrated circuit (IC) package.

FIG. 2 illustrates in full lines a finished, quality product 10 whoseleads 22-1 through 22-n and leads 24-1 through 24-n are in-line, i.e.,the leads extend parallel to one another as seen from this side view.The product 10 may not exhibit satisfactory quality if one or more ofthe leads 22-1 through 22-n or leads 24-1 through 24-n are substantiallybent from their parallel position along any imaginary line 1₁, parallelto imaginary axis A₁. This is indicated for lead 22-4, which may be bentalong line 1₁, rearwardly, as shown by the dashed line, or frontwardly,as shown by the chain-dot line. This type of bending along parallel line1₁, is termed "parallel bending." Whereas all the leads 22-1, . . . 22-nof an in-line product 10 are spaced-apart from one another apre-designed distance d₁, this does not occur with a bent lead, such asbent lead 22-4, which is closer to or further away from adjacent leadsthan designed. If the distance d₁ between adjacent leads does not meetgiven tolerances, the package 10 should be rejected.

FIG. 3 illustrates in full lines the finished quality product 10 whoseleads 22-1 through 22-n and leads 24-1 through 24-n are in-line, i.e.,the leads are inclined and parallel to one another as seen from this endview. The product 10 may not exhibit satisfactory quality if one or moreof the leads 22-1 through 22-n or leads 24-1 through 24-n aresubstantially bent from their inclined parallel position along anyimaginary line 1₂ perpendicular to line 1₁ and parallel to imaginaryaxis A₂. This is indicated for lead 22-2 which may be bent along line 1₂outwardly, as shown by the dashed line, or inwardly, as shown by thechain-dot line. This type of bending along perpendicular line 1₂ istermed "camber bending." A package 10 may not meet quality controlspecifications if a bent lead, such as lead 22-2, is bent a distance d₂beyond given tolerances.

A third type of bending, called "combined bending", is discussed morefully below. A lead having "combined bending" has a component of"parallel bending" and a component of "camber bending".

FIG. 4 illustrates the three types of bending. The lead 22-4 is shown ashaving only "parallel bending" with distance d₁ being shorter thandesigned. The lead 22-2 is shown as having only "camber bending", withdistance d₂ having a larger than designed value. A lead 24-3 is shown ashaving a "combined bending" since it has a component of "parallelbending" of distance d₁ and a component of "camber bending" of distanced₂.

FIG. 5 illustrates yet another defect that can accompany a finishedproduct 10. A high-quality product 10 will have the cover 28substantially, if not precisely, aligned, edge-for-edge, over the base26. FIG. 5 shows a defective product 10 in which the cover 28 is offsetfrom or overlaps the base 26 by a distance d₃.

FIG. 6 and FIG. 7 illustrate an optical system 30 for producing datathat has information for determining the alignment of one or more leads22 or leads 24 and, in particular, to determine if there is "parallelbending". Relative movement between the optical system 30 and theproduct 10 is indicated by the arrow. The optical system 30 includes alight source 32 on the right side 20 of product 10 that produces a lightbeam traversing a path 34 which, as seen from FIG. 6, is along line 1₂and, hence, perpendicular to line 1₁. A sensor 36, on the left side 18,senses the light beam from source 32 traversing path 34. As seen in FIG.7, source 32 is elevated slightly relative to product 10 so that thelight beam traversing path 34 is slightly inclined and intersects onlythe leads 22 and not leads 24. Note that the light beam traversing path34 is still along line 1₂ which also has been elevated slightly but isstill perpendicular to line 1₁. Consequently, as will be furtherdescribed, sensor 36 will provide output data having information of the"parallel bending" of only the leads 22. As already indicated, onereason for slightly elevating source 32 is to avoid intersecting leads24, which otherwise could obstruct the light path 34. If package 10 hadno leads 24, source 32 need not be elevated, as viewed in FIG. 7; ratherpath 34, and the light beam traversing path 34, could be level. Ineither case, path 34 can be considered to extend along line 1₂perpendicular to line 1₁.

If product 10 had only leads 22 and not leads 24, then optical system 30need only include source 32 and sensor 36 to determine "parallelbending". Since product 10 also has leads 24, optical system 30 includesa light source 38 on the left side 18 that produces a light beamtraversing a path 40 which, as seen in FIG. 6, is along line 1₂ and,hence, perpendicular to line 1₁. A sensor 42, on the right side 20,senses the light beam from source 38 traversing path 40. As seen in FIG.7, source 38 is elevated relative to product 10 for similar reasons assource 32 so that the light beam traversing path 40 intersects only theleads 24 extending from the right side 20. Consequently, as will becomeapparent, sensor 42 will provide output data having information of the"parallel bending" of only the leads 24.

If the leads 22, 24 of product 10 were constrained to have only"parallel bending", then only the above described light sources 32, 38and sensors 36, 42 are required for Quality Control. However, as alreadymentioned, the leads 22, 24 are subject to "camber bending" and"combined bending". Therefore, optical system 30 includes additionaloptical components for providing data having information of the"combined bending", from which can be derived information of the "camberbending".

More particularly, as shown in FIG. 8 and FIG. 9, optical system 30, inaddition to the optical components shown in FIG. 6 and FIG. 7, includesa light source 44 on the right side 20 of product 10 that produces alight beam traversing a path 46, and a sensor 48 on the left side 18that senses the light traversing path 46. As may be appreciated fromFIG. 8, the path 46 is at an angle to the line 1₁, i.e., to the"parallel bending", and at an angle to the line 1₂, i.e., to the "camberbending". As one example, each angle can be optimally 45°. As seen inFIG. 9, source 44 is slightly elevated relative to product 10 so thatthe light beam traversing path 46 intersects only the leads 22 extendingfrom the left side 18. Consequently, as will be further described,sensor 48 will provide output data having information of the "combinedbending" of only leads 22.

Since product 10 also has leads 24, optical system 30 includes a lightsource 50 on the left side 18 that produces a light beam traversing apath 52, and a sensor 54 on the right side 20 that senses the lighttraversing path 52. As seen in FIG. 8, the path 52 is at an angle to theline 1₁, i.e., to the "parallel bending", and at an angle to the line1₂, i.e., to the "camber bending". As seen in FIG. 9, source 50 isslightly elevated relative to product 10 so that the light beamtraversing path 52 intersects only the leads 24 extending from the rightside 20. Source 44 and source 50 are slightly elevated for similarreasons described above.

Various embodiments of optical techniques may be employed in accordancewith the principles of the present invention to acquire data fordetermining the alignment of the leads 22 or leads 24 and, inparticular, for determining the interspatial distance between the leads.Optical system 30 is one embodiment and is based, in part, on therealization that only a small area or point of each lead need beexamined optically to acquire sufficient data for these purposes. Thisis illustrated in FIG. 6 through FIG. 9 which show that the light paths34, 40, 46, 52 intersect the leads 22, 24 at respective small points P₁,P₂, P₃, P₄ on the leads 22, 24. The points P₁ -P₄ preferably areapproximately one eighth to one quarter of the distance down from thetop of aligned leads 22, 24. Since only such points P₁ -P₄ are examined,each light source 32, 38, 44, 50 can be, for example, a point lightsource emitting, for example, infrared light, and each sensor 36, 42,48, 54 can be a single photodetector such as a phototransistor detectingthe infrared light.

In another embodiment of an optical system (not shown), each point lightsource 32, 38, 44, 50 can be replaced by, for example, a light sourcewhose light is controlled to intersect the entire leads 22, 24, and eachsingle photodetector 36, 42, 48, 54 can be replaced by a linearphotodiode array. Such a light source can be a laser. As the product 10moves relative to this other optical system, the linear photodiode arraywill output data corresponding to each entire lead.

Another embodiment of an optical system may include a light source thatilluminates an entire line of leads such as leads 22, with the product10 being stationary. A sensor for this system may be a TV camera thatelectronically scans this "picture" of all the leads.

Note that in all of the above-mentioned optical systems, optical datawill be acquired of at least points P₁ -P₄ on each lead. One advantageof acquiring optical data only of points P₁ -P₄ for each lead is thatthe amount of data that is processed electronically, as will bediscussed, is minimized. Furthermore, infrared point sources and singlephototransistors are less costly than lasers, linear photodiode arraysand TV cameras.

FIG. 10 illustrates one example of the combined positioning of thevarious optical components of optical system 30 thus far described. Inaddition, for lead-alignment determining purposes, optical system 30includes a light source 56 that produces a light beam traversing a path58 extending across and intersecting body 12. A sensor 60 senses thelight beam traversing path 58. Another light source 62 produces a lightbeam traversing a path 64 extending across and intersecting body 12. Asensor 66 senses the light beam traversing path 64.

As viewed in FIG. 10, path 58 is anterior of the paths 34, 40, 46, 52 inthe direction of travel of product 10, whereas path 64 is posterior ofthe paths 34, 40, 46, 52. Light source 56 and light source 62 arespaced-apart a predetermined distance D, e.g., 2", and sensors 60, 66detect when front end 14 intersects paths 58, 64, respectively. As willbe further described, the output data of sensors 60, 66 are used todetermine the spacing of each lead 22, 24 relative to a reference pointwhich is the front end 14 by considering the average velocity of product10.

A self-contained module 68 for the optical system 30 is shown in FIG.11. The module 68 has a housing 70 that provides a channel 72 throughwhich the product 10 is movable in the direction indicated by the arrow,and has a cable connector 74. With reference to FIG. 11 and FIG. 12, oneside 76 of housing 70 to the left of channel 72 includes a printedcircuit board 78 having apertures 80 that are on locating pins 82extending through upper and lower brackets 84. A glass plate 86 extendsover the printed circuit board 78. The side 87 of housing 70 to theright of channel 72 has similar components (not shown).

FIG. 13 illustrates a portion of optical system 30 which is embodied onthe printed circuit board 78. Also shown in phantom lines is the product10 as it moves along channel 72 in the direction indicated by the arrow.Printed circuit board 78 has, in series, sensor 60, sensor 36, lightsource 38, light source 50, sensor 48 and sensor 66 that are also shownin FIG. 10. The printed circuit board (not shown) on the right side ofchannel 72 has, in series, the light source 56, light source 32, sensor42, light source 44, sensor 54 and light source 62 shown in FIG. 10.

Yet another sensor 88 is shown in FIG. 13 and is positioned beneathsensor 60. The combination of sensor 60, which is in-line with cover 28,and sensor 88, which is in-line with base 26, is used to provide datafor detecting the offset problem illustrated in FIG. 5 and indicated inFIG. 13. Another light source (not shown) and light path (not shown) aredirectly under light source 56 and path 58 (see FIG. 10). Because, asshown in FIG. 13, the cover 28 is offset from the base 26, the formerwill intersect light path 58 (see FIG. 10) at a different time than thelatter will intersect the light path (not shown) under path 58 asproduct 10 moves through module 68. Consequently, the output data fromone sensor 60, 88 will be delayed relative to the output data of theother sensor 60, 88 and this indicates the offset.

The space or distance betweeen side 76 and side 87 at which the printedcircuit boards are held will be different from one module 68 to anothermodule 68. This spacing will be dependent on the width of a givenpackage 10. The reason for this, as can be seen, is to ensure that thevarious light paths cross the same points P₁ -P₄ on the leads for anywidth package. A wider package requires a wider spacing. By changingthis spacing of the modules, the same printed circuit boards can be usedfor all modules.

FIG. 14 shows an electro-optical system 90 for determining theinterspatial distance of leads 22 and of leads 24 of a product 10, and,hence, the alignment of these leads. While electro-optical system 90will be described using the optical system 30, it will becomeappreciated that the other optical systems mentioned above can be usedto acquire data on which to determine this interspatial distance.

As indicated in block diagrams, electro-optical system 90 includes sevenlight sources 92, corresponding respectively to light sources 32, 38,44, 50, 56, 62, and the source (not shown) beneath source 56, sevenlight paths 94 corresponding, respectively, to paths 34, 40, 46, 52, 58,64, and the path (not shown) beneath path 58 and seven sensors 96corresponding respectively to sensors 36, 42, 48, 54, 60, 66, 88. Theoutput data of sensors 96 are produced as pulse waveforms on sevenrespective output lines 98 and each pulse waveform is threshold detectedby respective threshold detectors 100. If it is assumed that the pulsesof each waveform on lines 98 exceed the threshold set in thresholddetectors 100, then the latter produces seven rectangular wave pulsewaveforms shown in FIG. 15.

A pulse waveform W₆₀ shown in FIG. 15 corresponds to the output datafrom sensor 60. A pulse waveform W₈₈ corresponds to the output data ofsensor 88. A pulse waveform W₃₆ corresponds to the output data fromsensor 36. A pulse waveform W₄₂ corresponds to the output data fromsensor 42. A pulse waveform W₄₈ corresponds to the output data fromsensor 48. A pulse waveform W₅₄ corresponds to the output data fromsensor 54. A pulse waveform W₆₆ corresponds to the output data fromsensor 66. All the pulse waveforms shown in FIG. 15 in full linerepresent a product 10 whose leads 22 and leads 24 are in-line, andwhose cover 28 and base 26 are precisely aligned. The dotted lines areused to explain bending of the leads 22, 24 and an offset between thecover 28 and base 26.

A leading edge E₁ of waveform W₆₀ is produced when the cover 28 at frontend 14 traverses path 58. A leading edge E₂ of waveform W₈₈ is producedwhen the base 26 at front end 14 traverses the path beneath path 58. Thedotted line of waveform W₈₈ showing a leading edge E₂ ' relative to edgeE₁ is information that cover 28 is offset relative to base 26. The fulllines showing the aligned position of edge E₁ and edge E₂ is informationthat cover 28 and base 26 are not offset.

A leading edge E₃ of waveform W₆₆ is produced when front end 14traverses path 64. As will be more fully described, the time between theoccurrence of edge E₁ and edge E₃ is used to determine the velocity orspeed of product 10 through optical system 30. It will be assumed untilotherwise indicated that the product 10 is moving at a constantvelocity. Also, the edge E₁, since it corresponds to front end 14, isused as a reference from which to determine the interspatial distancebetween leads 22 or leads 24.

Waveform W₃₆ shows a plurality of leading edges e₁ -e_(n) corresponding,respectively, to leads 22-1 to 22-n. Each edge e₁ -e_(n) of waveform W₃₆is produced when respective leads 22-1 to 22-n traverse path 34. Theedges e₁ -e_(n) are equally spaced from one another, providinginformation that there is no "parallel bending" of any one or more ofthe leads 22. As shown in dotted line, an edge e₄ ' corresponding tolead 22-4 is closer to edge e₃, which provides information that there is"parallel bending" of lead 22-4 frontwardly.

Waveform W₄₂ shows a plurality of leading edges e₁ -e_(n) corresponding,respectively, to leads 24-1 to 24-n. Each edge e₁ -e_(n) of waveform W₄₂is produced when respective leads 24-1 to 24-n traverse path 40. Theedges e₁ -e_(n) of waveform W₄₂ are equally spaced from one another,providing information that there is no "parallel bending" of any one ormore of the leads 24.

Waveform W₄₈ shows a plurality of leading edges e₁ -e_(n) corresponding,respectively, to leads 22-1 to 22-n. Each edge e₁ -e_(n) of waveform W₄₈is produced when respective leads 22-1 to 22-n traverse path 46. Theseedges e₁ -e_(n) are equally spaced from one another, providinginformation that there is no "combined bending". The dotted line showingedge e₄ ' of waveform W₄₈ provides information that there may be"combined bending" for lead 22-4 since it is closer to edge e₃.

Since path 46 is at an angle as previously described, this "combinedbending" information alone does not indicate the amount or component of"parallel bending" and the amount or component of "camber bending".However, from waveform W₃₆, the distance between edge e₄ ' and edge e₃gives information of the component of "parallel bending". Then, bysubtracting this "parallel bending" component from the distance betweenedge e₄ ' and edge e₃ of waveform W₄₈, the component of "camber bending"is identified. If the subtraction results in 0, then there is only"parallel bending". If the subtraction results in a number greater than0, then there is a component of "camber bending" corresponding to thisnumber. If, as another example, waveform W₃₆ shows no "parallel bending"for lead 22-4 corresponding to the full line edge e₄, but dotted line e₄' of waveform W₄₈ shows "combined bending", then the subtractionindicates only "camber bending".

Waveform W₅₄ shows a plurality of leading edges e₁ -e₂ corresponding,respectively, to leads 24-1 to 24-n. Each edge e₁ -e_(n) of waveform W₅₄is produced when respective leads 24-1 to 24-n traverse path 52. Theedges e₁ -e_(n) of waveform W₅₄ are equally spaced, providinginformation that there is no "combined bending" for leads 24.

Electro-optical system 90 includes a data processor shown generally at102. A digital signal pre-processor 104 receives the seven pulsewaveforms W₆₀, W₈₈, W₃₆, W₄₂, W₄₈, W₅₄ and W₆₆ over seven lines 106 andcombines them to extract five output pulse waveforms W₁ -W₅, shown inFIG. 16, on five lines 108.

Waveform W₁ is a combination of waveform W₆₀ and waveform W₈₈. Ifwaveform W₁ has no pulses, as shown in full line, this indicates thatedge E₁ of waveform W₆₀ and edge E₂ of waveform W₈₈ coincide and,therefore, that cover 28 and base 26 are precisely aligned. Otherwise, apulse P shown in dotted line is produced to indicate the offset betweencover 28 and base 26, with one edge corresponding, for example, to edgeE, and the other edge to edge E₂ '.

Waveform W₂ is a combination of waveforms W₆₀, W₃₆, but inverted. Likereference numerals in waveform W₂ are used to indicate like leadingedges in waveforms W₆₀, W₃₆. Similar referencing is employed for theother waveforms W₃, W₄, W₅, W₆. Waveform W₃ is a combination ofwaveforms, W₆₀, W₄₂, waveform W₄ is a combination of waveforms W₆₀, W₄₈,waveforms W₅ is a combination of waveform W₆₀, W₅₄, and waveform W₆ is acombination of waveforms W₆₀, W₆₆. These six waveforms W₁ -W₆ areproduced by performing logical operations with various logic gates (notshown) in digital signal pre-processor 104.

Data processor 102 has six retriggerable timers 110 each receiving oneof the waveforms W₁ -W₆. The timers 110 are clocked by a common clock112. As one example, and with respect to waveform W₂, the occurrence ofedge E₁ commences the counting of clock pulses from clock 112 by one ofthe timers 110 from a count of 0. Then, as each edge e₁ -e_(n) occurs,the one timer 110 outputs a 16-bit number corresponding to a cumulativetime of occurrence of an edge e₁ -e_(n) relative to edge E₁. Then,assuming the velocity of product 10 is known, as will be furtherdiscussed, this timing information provided by each 16-bit number isconverted to data indicating the distance between an edge e₁ -e_(n) andedge E₁ or, in other words, the distance between a corresponding lead 22and the reference front end 14. The difference between these 16-bitnumbers is the interspatial distance betwee leads 22. Similar 16-bitnumbers are produced by the other timers 110 in response to waveforms W₃-W₆. For waveform W₁, if no pulse occurs, as shown in full lines, a16-bit number equal to 0 is produced by one of the timers 110 toindicate no offset between cover 28 and base 26, whereas a pulse P inwaveform W₁ will produce a 16- bit number corresponding to the width ofpulse P informing of an offset. The 16-bit numbers are outputted by thetimers 110 on six respective lines 114.

A microprocessor 116 and an arithmetic processor 118, under softwarecontrol to be further described, processes the 16-bit data beingreceived on lines 114. Calculations are made from this data of theinterspatial distance between leads 22 and leads 24. If thesecalculations show that one or more of the leads has been subjected to"parallel bending" or "camber bending" beyond predetermined tolerances,data for which are stored in memory, a decision is made to reject theproduct 10 and a control signal is produced on an output line 120 soindicating. Otherwise, a decision is reached that the product 10 has allleads which are in-line and another control signal is produced on line120 so indicating. Similar decisions can be made in response to thewaveform W₁ in determining if product 10 should be rejected due to anoffset beyond acceptable tolerances.

FIG. 17 illustrates an automatic package handler 122 which may be usedwith self-contained module 68. Package handler 122 may be any one ofseveral models manufactured by Trigon Industries, Inc., Mountain View,Calif., such as Models T-2010 through 2080 but slightly modified toaccommodate module 68. Package handler 122 has a processing trough 124,rails 126 defining a channel 128, and a pivotally mounted centerretainer 130 that is pivotally mounted on brackets 132 via arms 134.

The module 68 is supported on the trough 124 so that channel 72 isaligned with channel 128. A sort mechanism 136, having rails 138 and achannel 140, is pivotally mounted on trough 124. A universal outputdevice 142 has three fixed channels 144, 146, 148 which will be alignedwith channel 140 depending on the pivotal position of sort mechanism136.

Package handler 122 is a gravity-fed device and is at an angle θ to thehorizontal, as indicated in FIG. 18. A package 10, after being fed intochannel 128 with its leads 22, 24 extending upwardly and center retainer130 over cover 28, falls by gravity through module 68 and into channel140 of sort mechanism 136. Then, depending on the decision made byopto-electronic system 90, sort mechanism 136 is pivoted to output thepackage 10 in one of channels 144, 146, 148. Package handler 122 has asystem (not shown) called a "singulator", which will allow a pluralityof packages 10 to be fed into or held in the upper portion of channel128, but process only one package 10 at time through module 68. Thisprocessing will be described in more detail in connection with FIG. 22.

FIG. 19 illustrates a package 10 being in the channel 128. Rails 126 areshaped at 150 to follow the contour of any particular base 26. Thisshape inhibits oscillating motion of the package 10 in the direction ofthe double headed arrow as it is fed through module 68 to reduce noisein the optical data. FIG. 20 shows in more detail the relationship ofmodule 68 to rails 126.

With respect to the manner of calculating the interspatial distancesbetween the leads 22 or leads 24, the timing data from timers 110 andshown in FIG. 16 are gathered by microprocessor 116. Then, for reasonswhich will be discussed, the timing data is linearized for the effect ofacceleration under free-fall of product 10 through optical system 30,and then converted into distances according to the following formula:

    X.sub.n =T.sub.SUM [V.sub.R -A(T.sub.R -T.sub.SUM)]        (1)

where

    V.sub.R =X.sub.R /T.sub.R ; A=g(sin θ)/2; T.sub.SUM =t.sub.1 +t.sub.2 + . . . +t.sub.n

θ=the incline shown in FIG. 18 from the horizontal of the fall directionof product 10

g=the gravitational constant

X_(R) =the predetermined reference distance D between path 58 and path64 shown in FIG. 10

T_(R) =the time represented by pulse P₁ of waveform W₆ for product 10,e.g. front end 14, to fall through X_(R)

V_(R) =average velocity of product 10

t_(n) =the incremenetal time indicated in FIG. 16

X_(n) =the distance of each lead from the front end 14 determined fromthe elapsed time t_(n).

For the general case of free-fall under gravitational force, equation 1is solved for each time event shown by the waveforms in FIG. 16 inaccordance with the following procedure shown in FIG. 21. First, theconstant A is computed (block 152), then the average velocity V_(R) iscalculated (block 154), and then a register holding T_(SUM) is set equalto 0 (block 156).

Next, the time t_(n) is added to T_(SUM) (block 158) and then X_(n) iscalculated (block 160). Then X_(n) is stored or saved in a result arrayfor later use (block 162). If there is no more data (block 164), i.e.,if all the leads have passed through optical system 30, then the programexits; otherwise, a loop is made via line 166 to calculate and storeX_(n) for another lead.

Having calculated and stored X_(n) for each lead, microprocessor 116 hassufficient data now to go through another simple routine under softwarecontrol to determine the interspatial distance between the leads to makea decision whether there is "parallel bending" and/or "camber bending."Thus, for example, to determine if there is any "parallel bending" ofleads 22 beyond given tolerances, X_(n) for one lead 22 can besubtracted from X_(n) for an adjacent lead 22, where these X_(n) 's arecalculated from waveform W₂. The difference then can be compared to thepredetermined stored tolerance data, as mentioned previously.

As shown in FIGS. 17-20, the product 10 is gravity-fed through opticalsystem 30 and, in particular, module 68. Consequently, because of theeffects of gravity, the product 10 is constantly accelerating so thatthe leads nearer the rearward end 16 will move faster through module 68than the leads nearer the front end 14. Of course, though, theinterspactial distance of the leads will remain the same. Consequently,the software preferably should linearize the data to account for thisacceleration.

Furthermore, the principles of the present invention apply if angle φ is0 such that, for example, product 10 is being moved through a module 68on a conveyor belt (not shown) at a known constant velocity, rather thenvia package handler 122. In this event, A=0 and equation 1 issimplified, and data of the known constant velocity can be prestored inmemory.

Also, while digital signal pre-processor 104 and waveforms W₁ -W₅ ofFIG. 16 have been shown and described, as well as the algorithm of FIG.21, it will be appreciated that the waveforms shown in FIG. 15 containall the data needed to determine the interspatial distances of the leads22, 24. Thus, other pre-processors and other algorithms may be used todetermine these distances.

With reference again to FIGS. 17-20 and to FIG. 22, and in particular tothe "singulator" of the package handler 122 previously mentioned, aprocedure will be described that allows a substantial number of products10 to be processed and sorted, for example, as many as about10,000/hour. As one example, center channel 146 of universal outputdevice 142 can receive good products 10, side channel 148 can receivebad, but repairable products 10, and side channel 144 can receive badunrepairable products 10.

Generally, a plurality of products are fed onto channel 128 and held bya solenoid-operated stop of the "singulator" near the top portion ofchannel 128 as indicated by a reference numeral 168 in FIG. 17. Anothersolenoid-operated stop is at a lower position as indicated by areference numeral 170 in FIG. 17. Just prior to releasing the nextproduct 10 from stop 168, the last product 10 that was gravity fedthrough module 68 is stopped at stop 170. If this last product 10 wasgood, then sort mechanism 136 may remain in the position shown in FIG.17 to direct this product into channel 146. This last product,therefore, may be released from stop 170 into channel 146 at the sametime the next product 10 being held at stop 168 is released forprocessing through module 68 since no time is required for moving thesort mechanism from the center position. If the last product was notgood, time should be allowed before the next product is released by stop168 to move the sort mechanism 136 either to the left or right to sortthe last product and then to return to the center position inanticipation of receiving the next product.

The above procedure is illustrated in more detail in FIG. 22. Assumethat a number or line of products 10 have been fed onto channel 128 withthe next product in line being at stop 168 (block 172) and the lastproduct already processed by module 68. This next product is now readyto be "singulated" (block 174). If the last product presently at stop170 was good (block 176), the next product at stop 168 is released(block 178) and the last product is sorted (block 180). If the lastproduct was not good (block 176) and if the last product is or is notrepairable (block 182), sort mechanism 136 is moved to the right tochannel 148 (block 184) or to the left to channel 144 (block 186), andthen returned to the center position (block 188). Then, the next productat stop 168 is released (block 190) to module 68 so that data isacquired (block 192), lead interspatial distances are calculated (block194), and a comparison made between those distances and the storedtolerance data (block 196). The program then loops via line 198 to"singulate" another product at stop 168 (block 174).

Other aspects, objects and advantages of this invention can be obtainedfrom a study of the drawings, the disclosure and the appended claims.

We claim:
 1. Apparatus for determining the alignment of at least onelead extending from a body having an axis, the lead being subject tobending along a first line parallel to the axis or being subject tobending along a second line perpendicular to the first line or beingsubject to a combined bending having a component along the first lineand a component along the second line, comprising:(a) first means forproducing a first light beam being adapted to traverse a first pathalong the second line and to intersect the lead; (b) first means forsensing the first light beam; (c) second means for producing a secondlight beam being adapted to traverse a second path at an angle to thefirst line and the second line and to intersect the lead; and (d) secondmeans for sensing the second light beam.
 2. Apparatus according to claim1 wherein said first means for producing comprises a first source oflight.
 3. Apparatus according to claim 2 wherein said second means forproducing comprises a second source of light.
 4. Apparatus according toclaim 3 wherein said first means for sensing and said second means forsensing each comprises a photodetector.
 5. Apparatus according to claim1 wherein the angle is optimally 45° to the first line and the secondline.
 6. Apparatus for determining the alignment of any one or more of aplurality of first leads and second leads extending from a body havingan axis, a first side at which the first leads are located and a secondside at which the second leads are located, any one or more of the firstleads and second leads being subject to bending along a first lineparallel to the axis or being subject to bending along a second lineperpendicular to the first line or being subject to a combined bendinghaving a component along the first line and a component along the secondline, comprising:(a) first means for producing a first light beam beingadapted to traverse a first path along the second line and to intersectonly the first leads; (b) first means for sensing the first light beam;(c) second means for producing a second light beam being adapted totraverse a second path along the second line and to intersect only thesecond leads; (d) second means for sensing the second light beam; (e)third means for producing a third light beam being adapted to traverse athird path at an angle to the first line and the second line and tointersect only the first leads; (f) third means for sensing the thirdlight beam; (g) fourth means for producing a fourth light beam beingadapted to traverse a fourth path at an angle to the first line and thesecond line and to intersect only the second leads; and (h) fourth meansfor sensing the fourth light beam.
 7. Apparatus according to claim 6wherein the body has a front end, and further comprising:(a) fifth meansfor producing a fifth light beam being adapted to traverse a fifth pathextending across and intersecting the front end, the fifth path beinganterior of the first through fourth paths; (b) fifth means for sensingthe fifth light beam; (c) sixth means for producing a sixth light beambeing adapted to traverse a sixth path extending across and intersectingthe front end, the sixth path being posterior of the first throughfourth paths and at a predetermined distance from the fifth path; and(d) sixth means for sensing the sixth light beam.
 8. Apparatus accordingto claim 6 wherein the body has a cover and a base, the first leads andthe second leads being supported on the base between the cover and base,and wherein the cover and base are subject to relative misalignment,further comprising:(a) fifth means for producing a fifth light beambeing adapted to traverse a fifth path extending across and intersectingthe cover; (b) fifth means for sensing the the fifth light beam; (c)sixth means for producing a sixth light beam being adapted to traverse asixth path extending across and intersecting the base; and (d) sixthmeans for sensing the sixth light beam.
 9. A self-contained module fordetermining the alignment of any one or more of a plurality of firstleads and second leads extending from a body having an axis, a firstside at which the first leads are located and a second side at which thesecond leads are located, any one or more of the first leads and secondleads being subject to bending along a first line parallel to the axisor being subject to bending along a second line perpendicular to thefirst line or being subject to a combined bending having a componentalong the first line and a component along the second line,comprising:(a) a housing having a first side and a second side spacedapart from said first side, said first side and said second side of saidhousing defining a channel through which the body is movable; (b) afirst circuit board and a second circuit board having optical means forgenerating lead-alignment data, said optical means including(i) firstmeans for producing a first light beam being adapted to traverse a firstpath along the second line and to intersect only the first leads; (ii)first means for sensing the first light beam; (iii) second means forproducing a second light beam being adapted to traverse a second path atan angle to the first line and the second line and to intersect only thefirst leads; and (iv) second means for sensing the second light beam;(c) first means for supporting said first circuit board on said firstside of said housing; and (d) second means for supporting said secondcircuit board on said second side of said housing.
 10. A self-containedmodule according to claim 9 wherein said first circuit board and saidsecond circuit board each includes a plurality of alignment holes, andsaid first supporting means and said second supporting means eachincludes a plurality of alignment pins for receiving said alignmentholes.
 11. A self-contained module according to claim 9 wherein thespacing between said first circuit board supported on said firstsupporting means on said first side of said housing and said secondcircuit board supported on said second supporting means on said secondside of said housing is predetermined relative to the size of the body.12. A self-contained module for determining the alignment of any one ormore of a plurality of first leads and second leads extending from abody having an axis, a first side at which the first leads are locatedand a second side at which the second leads are located, any one or moreof the first leads and second leads being subject to bending along afirst line parallel to the axis or being subject to bending along asecond line perpendicular to the first line or being subject to acombined bendng having a component along the first line and a componentalong the second line, comprising:(a) a housing having a first side anda second side spaced-apart from said first side, said first side andsaid second side of said housing defining a channel through which thebody is movable; (b) a first circuit board and a second circuit boardhaving optical means for generating lead alignment data; (c) first meansfor supporting said first circuit board on said first side of saidhousing; (d) second means for supporting said second circuit board onsaid second side of said housing; and (e) wherein said optical means forgenerating lead-alignment data includes(i) first means, supported onsaid second circuit board, for producing a first light beam beingadapted to traverse a first path along the second line and to intersectonly the first leads; (ii) first means, supported on said first circuitboard, for sensing the first light beam; (iii) second means, supportedon said first circuit board, for producing a second light beam beingadapted to traverse a second path along the second line and to intersectonly the second leads; (iv) second means, supported on said secondcircuit board, for sensing the second light beam; (v) third means,supported on said second circuit board, for producing a third light beambeing adapted to traverse a third path at an angle to the first line andthe second line and to intersect only the first leads; (vi) third means,supported on said first circuit board, for sensing the third light beam;(vii) fourth means, supported on said first circuit board, for producinga fourth light beam being adapted to traverse a fourth path at an angleto the first line and the second line and to intersect only the secondleads; and (viii) fourth means, supported to said second circuit board,for sensing the fourth light beam.
 13. A self-contained module accordingto claim 12 wherein the body has a front end, and wherein said opticalmeans further comprises:(a) fifth means for producing a fifth light beambeing adapted to traverse a fifth light path extending across andintersecting the front end, the fifth path being anterior of the firstthrough fourth paths; (b) fifth means for sensing the fifth light beam;(c) sixth means for producing a sixth light beam being adapted totraverse a sixth path extending across and intersecting the front end,the sixth path being posterior of the first through fourth paths and ata predetermined distance from the fifth path; and (d) sixth means forsensing the sixth light beam.
 14. A self-contained module according toclaim 12 wherein the body has a cover and a base, the first leads andthe second leads being supported on the base between the cover and thebase, and wherein the cover and the base are subject to relativemisalignment, and wherein said optical means further comprises:(a) fifthmeans for producing a fifth light beam being adapted to traverse a fifthpath extending across and intersecting the cover; (b) fifth means forsensing the fifth light beam; (c) sixth means for producing a sixthlight beam being adapted to traverse a sixth path extending across andintersecting the base; and (d) sixth means for sensing the sixth lightbeam.
 15. Apparatus for determining the alignment of a plurality ofleads on a body having an axis, the leads being spaced apart from eachother and wherein the leads are subject to bending along a first lineparallel to the axis or to bending along a second line perpendicular tothe first line or to a combined bending having a component along thefirst line and a component along the second line, comprising:(a) opticalmeans for producing data having information of the spacing between theleads, including(i) first means for producing a first light beam beingadapted to traverse a first path along the second line and to intersecteach of the leads; (ii) first means for sensing the first light beam andproducing first output data having information of the spacing betweenthe leads along the first line; (iii) second means for producing asecond light beam being adapted to traverse a second path at an angle tothe first line and the second line and to intersect the leads; and (iv)second means for sensing the second light beam and producing secondoutput data having combined information of the spacing between the leadsalong the first line and the second line; and (b) data processor meansfor determining the spacing between the leads in response to the firstand second output data.
 16. Apparatus according to claim 15 wherein saiddata processor means comprises:(a) first means for determining thedistance between the leads along the first line in response to the firstoutput data; and (b) second means for determining the distance betweenthe leads along the second line in response to the first output data andthe second output data.
 17. Apparatus according to claim 16 wherein saidsecond means for determining comprises means for subtracting theinformation of the first output data from the information of the secondoutput data.
 18. Apparatus for determining the alignment of any one ormore of a plurality of first leads spaced from one another and secondleads spaced from one another, the first leads and the second leadsextending from a body having an axis, a first end, a first side at whichthe first leads are located and a second side at which the second leadsare located, any one or more of the first leads and the second leadsbeing subject to parallel bending along a first line parallel to theaxis or being subject to camber bending along a second lineperpendicular to the first line or being subject to a combined bendinghaving a component of parallel bending along the first line and acomponent of camber bending along the second line, comprising:(a) meansfor moving the body; (b) optical means for producing first data havinginformation of the parallel bending of the first leads and the parallelbending of the second leads along the first line and for producingsecond data having information of the combined bending of the firstleads and the combined bending of the second leads along the first lineand along the second line, the body being movable relative to saidoptical means; and (c) data processor means for determining the parallelbending of the first leads and the parallel bending of the second leadsalong the first line in response to the first data and the camberbending of the first leads and the camber bending of the second leadsalong the second line in response to the first data and the second data.19. Apparatus according to claim 18 wherein said means for movingcomprises gravity-fed means for directing the body across said opticalmeans.
 20. Apparatus according to claim 18 wherein said optical meanscomprises:(a) first light source means for producing a first light beambeing adapted to traverse a first path along the second line and tointersect points on only the first leads; (b) first means for sensingthe first light beam and producing first output data having informationof the spacing between the first leads along the first line; (c) secondlight source means for producing a second light beam being adapted totraverse a second path along the second line and to intersect points ononly the second leads; (d) second means for sensing the second lightbeam and producing second output data having information of the spacingbetween the second leads along the first line; (e) third light sourcemeans for producing a third light beam being adapted to traverse a thirdpath at an angle to the first line and the second line and to intersectpoints on only the first leads; (f) third means for sensing the thirdlight beam and producing third output data having combined informationof the spacing between the first leads along the first line and thesecond line; (g) fourth light source means for producing a fourth lightbeam being adapted to traverse a fourth path at an angle to the firstline and the second line and to intersect points only on the secondleads; (h) fourth means for sensing the fourth light beam and producingfourth output data having combined information of the spacing betweenthe second leads along the first line and the second line; (i) fifthlight source means for producing a fifth light beam being adapted totraverse a fifth path extending across and intersecting the front end,the fifth path being anterior of the first through fourth paths; (j)fifth means for sensing the fifth light beam and producing fifth outputdata; (k) sixth light source means for producing a sixth light beambeing adapted to traverse a sixth path extending across and intersectingthe front end, the sixth path being posterior of the first throughfourth paths and at a predetermined distance from the fifth path; and(l) sixth means for sensing the sixth light beam and producing sixthoutput data, the fifth output data and the sixth output data havinginformation of the velocity of the body.
 21. Apparatus according toclaim 18 wherein the body has a shape, and said means for movingcomprises rails for guiding the body, said rails having a shapecontoured to the shape of the body.
 22. Apparatus for determining thealignment of at least one portion extending from an object having anaxis, the portion being subject to bending along a first line parallelto the axis or being subject to bending along a second lineperpendicular to the first line or being subject to a combined bendinghaving a component along the first line and a component along the secondline, comprising:(a) first means for producing a first light beam beingadapted to traverse a first path along the second line and to intersectthe portion; (b) first means for sensing the first light beam, (c)second means for producing a second light beam being adapted to traversea second path at an angle to the first line and the second line and tointersect the portion; and (d) second means for sensing the second lightbeam.
 23. Apparatus for determining the alignment of any one or more ofa plurality of first portions and second portions extending from anobject having an axis, a first side at which the first portions arelocated and a second side at which the second portions are located, anyone or more of the first portions and second portions being subject tobending along a first line parallel to the axis or being subject tobending along a second line perpendicular to the first line or beingsubject to a combined bending having a component along the first lineand a component along the second line, comprising:(a) first means forproducing a first light beam being adapted to traverse a first pathalong the second line and to intersect only the first portions; (b)first means for sensing the first light beam; (c) second means forproducing a second light beam being adapted to traverse a second pathalong the second line and to intersect only the second portions; (d)second means for sensing the second light beam; (e) third means forproducing a third light beam being adapted to traverse a third path atan angle to the first line and the second line and to intersect only thefirst portions; (f) third means for sensing the third light beam; (g)fourth means for producing a fourth light beam being adapted to traversea fourth path at an angle to the first line and the second line and tointersect only the second portions; and (h) fourth means for sensing thefourth light beam.
 24. Apparatus for determining the alignment of anyone or more of a plurality of first portions spaced from one another andsecond portions spaced from one another, the first portions and thesecond portions extending from an object having an axis, a first end, afirst side at which the first portions are located and a second side atwhich the second portions are located, any one or more of the firstportions and the second portions being subject to parallel bending alonga first line parallel to the axis or being subject to camber bendingalong a second line perpendicular to the first line or being subject toa combined bending having a component of parallel bending along thefirst line and a component of camber bending along the second line,comprising:(a) means for moving the object; (b) optical means forproducing first data having information of the parallel bending of thefirst portions and the parallel bending of the second portions along thefirst line and for producing second data having information of thecombined bending of the first portions and the combined bending of thesecond portions along the first line and along the second line, theobject being movable relative to said optical means; and (c) dataprocessor means for determining the parallel bending of the firstportions and the parallel bending of the second portions along the firstline in response to the first data and the camber bending of the secondportions along the second line in response to the first data and thesecond data.